package com.bobbygu.server.simpleapp.mapper;

import com.bobbygu.server.simpleapp.model.AppLogModel;
import org.apache.ibatis.annotations.*;

import java.util.ArrayList;

public interface AppLogMapper {
    @Select("select * from applog where token = #{token}")
    AppLogModel findAppLogByToken(String token);

    @Select("select * from applog")
    ArrayList<AppLogModel> selectAll();

    @Insert("insert into applog(name,type,createTime,content,token) values(#{name},#{type},#{createTime},#{content},#{token})")
    void insertAppLog(@Param("name") String name,
                      @Param("type") String type,
                      @Param("createTime") String createTime,
                      @Param("content") String content,
                      @Param("token") String token);

    @Delete("delete from applog where token=#{token}")
    void deleteAppLogByToken(@Param("token") String token);
}
